<?php slot('js_insideLoadFunction')?>
COMPANY.addChildCreate();
ADMIN_FORM.init();

<?php end_slot()?>
<div class="box-navigation">
	<?php echo $data['navigation']?>
</div>
<div class="clr"></div>
<div class="box-content">
	<form action="?action_name=<?php echo $data['action']?>" method="post" name="form_main" id="form_main">
		<?php echo $form['_csrf_token']?>
		<div class="clr"></div>
		<div class="box-content-main ">
			<div class="message"><?php echo empty($data['result'])?'':$data['result']?></div><div class="note"><?php echo __('is_require',null, 'table_list')?></div>
			<div class="clr"></div>
			<table class="table-list table-form" cellspacing="0" cellpadding="0" border="0">
				<tr class="class1">
					<td class="label"><?php echo __('label_staff_number_id',null,'company_companies')?><span class="required">*</span></td>
					<td class="input">
						<?php echo $form['staff_number_id']->render(array('class'=>'required' , 'data-require'=> 'selected'))?>
						<span class="error" id="type_error"><?php echo __('selected', null, 'table_list')?></span>
					</td>
				</tr>
				
				<tr class="class1">
					<td class="label"><?php echo __('label_company_name',null,'company_companies')?><span class="required">*</span></td>
					<td class="input">
						<?php echo $form['company_name']->render(array('class'=>'form-text required',  'data-require'=> 'not-empty'))?>
						<span class="error" id="type_error"><?php echo __('not_empty', null, 'table_list')?></span>
					</td>
				</tr>
				<tr class="class1">
					<td class="label"><?php echo __('label_description',null,'company_companies')?></td>
					<td class="input">
						<?php echo $form['company_description']->render(array('class'=> 'editor'))?>
					</td>
				</tr>
				
				<tr class="class1">
					<td class="label"><?php echo __('label_address',null,'company_companies')?><span class="required">*</span></td>
					<td class="input">
						<?php echo $form['address']->render(array('class'=>'form-text required', 'data-require'=> 'not-empty'))?>
						<span class="error" id="type_error"><?php echo __('not_empty', null, 'table_list')?></span>
					</td>
					
				</tr>
				
				<tr class="class1">
					<td class="label"><?php echo __('label_location_city_id',null,'company_companies')?></td>
					<td class="input">
						<?php echo $form['location_city_id']->render(array('class'=>'select-parent', 'data-child-id'=>'Companies_location_district_id', 'data-update'=>'/admin/candidates/getDistrict', 'data-child-select'=>__('option_select', null, 'table_list')))?>
					</td>
				</tr>
				<tr class="class1">
					<td class="label"><?php echo __('label_location_district_id',null,'company_companies')?></td>
					<td class="input">
						<?php echo $form['location_district_id']->render(array('type'=>'hidden'))?>
					</td>
				</tr>
				<tr class="class1">
					<td class="label"><?php echo __('label_is_in_longduc',null,'company_companies')?></td>
					<td class="input"><?php echo $form['is_in_longduc']->render(array('class'=>'required'))?></td>
					
				</tr>
				<tr class="class1">
					<td class="label"><?php echo __('label_email',null,'company_companies')?></td>
					<td class="input">
						<?php echo $form['email']->render(array('class'=>'form-text', 'data-require'=> 'email'))?>
						<span class="error" id="type_error"><?php echo __('error_email', null, 'table_list')?></span>
					</td>
					
				</tr>
				<tr class="class1">
					<td class="label"><?php echo __('label_website',null,'company_companies')?></td>
					<td class="input">
						<?php echo $form['website']->render(array('class'=>'form-text'))?>
					</td>
					
				</tr>
				<tr class="class1">
					<td class="label"><?php echo __('phone_number',null,'company_companies')?><span class="required">*</span></td>
					<td class="input">
						<?php echo $form['phone_number']->render(array('class'=>'number required', 'data-require'=> 'not-empty'))?>
						<span class="error" id="type_error"><?php echo __('not_empty', null, 'table_list')?></span>
					</td>
				</tr>
				<tr class="class1">
					<td class="label"><?php echo __('fax_number',null,'company_companies')?><span class="required">*</span></td>
					<td class="input">
						<?php echo $form['fax_number']->render(array('class'=>'number required', 'data-require'=> 'not-empty'))?>
						<span class="error" id="type_error"><?php echo __('not_empty', null, 'table_list')?></span>
					</td>
				</tr>
				<tr class="class1">
					<td class="label"><?php echo __('label_company_behalf',null,'company_companies')?></td>
					<td class="input">
						<table class="create-child" border="1" cellspacing="0" cellpadding="0" style="width:715px;"> 
							<tr>
								<td class="header"><?php echo __('name', null, 'company_person_contacts')?></td>
								<td class="header"><?php echo __('position', null, 'company_person_contacts')?></td>
								<td class="header"><?php echo __('email', null, 'company_person_contacts')?></td>
								<td class="header"><?php echo __('phone', null, 'company_person_contacts')?></td>
								<td class="header"><?php echo __('action', null, 'company_person_contacts')?></td>
							</tr>
							<?php foreach ($data['child']['person_contact'] as $person):?>
							<tr>
								<td class="child"><?php echo $person['name']?></td>
								<td class="child"><?php echo $person['CompanyPersonContactPositions']['name']?></td>
								<td class="child"><?php echo $person['email']?></td>
								<td class="child"><?php echo $person['phone_number']?></td>
								<td class="child-control">
									<a href="#" class="remove-child" title="">&nbsp;</a>
									<input name="personContacts[]" type="hidden" value="<?php echo $person['name'].';'.$person['position_id'].';'.$person['email'].';'.$person['phone_number']?>">
								</td>
							</tr>
							<?php endforeach;?>
							<tr>
								<td class="child" data-id="name"><input data-error="<?php echo __('error_name', null, 'company_person_contacts')?>" name="childName" class="child required" id="input_name" value=""/></td>
								<td class="child" data-id="position"><select data-error="<?php echo __('error_position', null, 'company_person_contacts')?>" name="childPosition" class="child required" id="input_position">
									<option value="-1"><?php echo __('option_select', null, 'table_list')?></option>
									<?php foreach($data['child']['position'] as $pos):?>
									<option value="<?php echo $pos['id']?>"><?php echo $pos['name']?></option>
									<?php endforeach;?>
								</select></td>
								<td class="child" data-id="email"><input  data-error="<?php echo __('error_email', null, 'company_person_contacts')?>" name="childEmail" class="" id="input_email" value=""/></td>
								<td class="child" data-id="phone"><input name="childPhone" class="number" id="input_phone" value=""/></td>
								<td class="child-control"><a href="#" class="add-child" title="">&nbsp;</a></td>
							</tr>
						</table>
					</td>
				</tr>
				<tr class="class1" style="display: none">
					<td class="label"><?php echo __('is_enabled',null,'table_list')?></td>
					<td class="input"><?php echo $form['is_enabled']->render(array('class'=>'required'))?></td>
				</tr>
				<tr class="class1" style="background:#fff">
					<td class="label">&nbsp;</td>
					<td class="input"><input type="button" id="button_submit" data-error="<?php echo __('submit_error', null, 'table_list')?>" name="button_submit" class="button" value="<?php echo $data['button_action']?>"/></td>
					
				</tr>
			</table>
		</div>
		<div class="clr"></div>
		<div class="control-back"><a href="<?php echo $data['redirect']?>" title="<?php echo __('control_back', null, 'table_list')?>" alt="<?php echo __('control_back', null, 'table_list')?>"><?php echo __('control_back', null, 'table_list')?></a></div>
	</form>
</div>